package LanQiao._14JavaB;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class _3数组分割 {

    @Test
    public void test() {
    }

    //WA  ?/?
    //组合的算法错误了
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            int size = scan.nextInt();
            int sum = 0;
            int count1 = 0, count2 = 0;
            for (int j = 0; j < size; j++) {
                int e = scan.nextInt();
                if (e % 2 == 0) {
                    count2++;
                }else {
                    count1++;
                }
                sum += e % 2;
            }
            if (sum % 2 == 0) {
                double x = (Math.pow(2, count1 == 0 ? 0 : count1 - 1) * Math.pow(2, count2 == 0 ? 0 : count2)) % 1000000007;
                arr[i] = (int)x;
            }else {
                arr[i] = 0;
            }
        }
        for (int i = 0; i < n; i++) {
            System.out.println(arr[i]);
        }
        scan.close();
    }

    /*
    public static int dp(int[] nums){
        int n = nums.length;
        int[] dp = new int[n];
        int count1 = 0, count2 = 0;
        int res = 0;
        for (int i = 0; i < n; i++) {
            if (nums[i] == 0) {
                for (int j = 0; j < i; j++) {
                    dp[i] += dp[j];
                    dp[i] %= 1000000007;
                }
                dp[i]++;
                count2++;
            }else {
                int helper = helper(count1, count2);
                dp[i] = helper;
                dp[i] %= 1000000007;
                count1++;
            }
        }
        for (int i = 0; i < n; i++) {
            res += dp[i];
            res %= 1000000007;
        }
        res = res + 1;
        return res;
    }*/
/*
    public static int helper(int count1,int count2){
        int res1 = 0;
        if (count1 >= 2) {
            for (int i = 0; i <= count1; i += 2) {
                int k = count1 - Math.max(i,count1 - i);
                int num = count1;
                int temp = 1;
                for (int j = 0; j < k; j++) {
                    temp *= num;
                    temp %= 1000000007;
                    num--;
                }
                res1 += temp % 1000000007;
            }
        }else {
            res1 = 1;
        }

        int res2 = 0;
        if (count2 != 0){
            for (int i = 0; i <= count2; i++) {
                int k = count2 - Math.max(i,count2 - i);
                int num = count2;
                int temp = 1;
                for (int j = 0; j < k; j++) {
                    temp *= num ;
                    temp %= 1000000007;
                    num--;
                }
                res2 += temp % 1000000007;
            }
        }else {
            res2 = 1;
        }
        return res1 * res2 % 1000000007;
    }*/


    //AC
    //组合规律
    // C_0|E + C_1|E + ... + C_n-1|E + C_E|E  = 2^E
    // C_0|F + C_2|F + ... + C_F-2|F + C_F|F  = 2^F-1
    // C_r|n = C_r-1|n-1 + C_r|n-1
    public static class Solution {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int T = scanner.nextInt();
            int[] ans = new int[T];
            for (int i = 0; i < T; ++i) {
                int N = scanner.nextInt();
                int evenCount = 0, oddCount = 0;
                for (int j = 0; j < N; ++j) {
                    int e = scanner.nextInt();
                    if (e % 2 == 0) ++evenCount;
                    else ++oddCount;
                    if (oddCount % 2 == 0)
                        ans[i] = (int) (Math.pow(2, evenCount) * Math.pow(2, oddCount == 0 ? 0 : oddCount - 1) % 1000000007);
                    else ans[i] = 0;
                }
            }
            scanner.close();
            for (int e : ans) System.out.println(e);
        }
    }


}
